home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr05 / ew120.zip / FILES1.ZIP / EWAPI.H < prev    next >
Text File  |  1993-05-02  |  18KB  |  439 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * ewapi.h -     E! API functions, types, and definitions                      *
  4. *                                                                             *
  5. *               Version 1.2                                                   *
  6. *                                                                             *
  7. *               Copyright (c) 1992,1993 Patrick Philippot, GIS                *
  8. *                                                                             *
  9. ******************************************************************************/
  10.  
  11. #ifndef _INC_EWAPI
  12. #define _INC_EWAPI      /* #defined if ewapi.h has been included */
  13.  
  14. /* Command codes used to identify EW functions within hooks */
  15.  
  16. #define ew_MFOpen            201
  17. #define ew_MFNew             202
  18. #define ew_MFClone           203
  19. #define ew_MFGet             204
  20. #define ew_MFWrite           205
  21. #define ew_MFAppend          206
  22. #define ew_MFSave            207
  23. #define ew_MFSaveAs          208
  24. #define ew_MFRefresh         209
  25. #define ew_MFGrep            210
  26. #define ew_MFAssociate       211
  27. #define ew_MFCC              215
  28. #define ew_MFPrint           217
  29. #define ew_MFPrintSetup      218
  30. #define ew_MFPageSetup       219
  31. #define ew_MFExit            221
  32. #define ew_MFExitEditor      222
  33.  
  34. #define ew_MEUndo            301
  35. #define ew_MEClearUndo       302
  36. #define ew_MECut             304
  37. #define ew_MECutAppend       305
  38. #define ew_MECopy            306
  39. #define ew_MECopyAppend      307
  40. #define ew_MEPasteIns        308
  41. #define ew_MEPasteOvr        309
  42. #define ew_MEClear           311
  43. #define ew_MESelectAll       312
  44. #define ew_MEDelete          314
  45. #define ew_MEDraw            316
  46. #define ew_MERecordMac       318
  47. #define ew_MELoadMac         319
  48. #define ew_MESaveMac         320
  49. #define ew_MEReplayMac       321
  50. #define ew_MEReplayMacN      322
  51. #define ew_MEAsciiMode       323
  52.  
  53. #define ew_MBSet             401
  54. #define ew_MBGotoMark1       403
  55. #define ew_MBGotoMark2       404
  56. #define ew_MBGotoMark3       405
  57. #define ew_MBRemoveMark1     407
  58. #define ew_MBRemoveMark2     408
  59. #define ew_MBRemoveMark3     409
  60. #define ew_MBGoto            411
  61. #define ew_MBGotoSel         412
  62. #define ew_MBCompare         414
  63.  
  64. #define ew_MSFind            501
  65. #define ew_MSRepeatFind      502
  66. #define ew_MSFindWord        503
  67.  
  68. #define ew_MCCompile         601
  69. #define ew_MCMake            602
  70. #define ew_MCRebuild         603
  71. #define ew_MCDebug           604
  72. #define ew_MCExecute         605
  73. #define ew_MCNext            607
  74. #define ew_MCPrevious        608
  75. #define ew_MCCommands        610
  76.  
  77. #define ew_MLSet             701
  78. #define ew_MLSaveCnf         702
  79. #define ew_MLLoadCnf         703
  80. #define ew_MLAssign          705
  81. #define ew_MLExpansion       707
  82.  
  83. #define ew_MWRibbon          801
  84. #define ew_MWHide            803
  85. #define ew_MWTile            805
  86. #define ew_MWCascade         806
  87. #define ew_MWHideAll         807
  88. #define ew_MWIconizeAll      808
  89. #define ew_MWScrolling       810
  90. #define ew_MWFont            812
  91.  
  92. #define ew_MULoadExt         901
  93. #define ew_MUUnloadExt       902
  94. #define ew_MUExecuteExt      903
  95. #define ew_MUAutoLoad        904
  96. #define ew_DefineMenu        906
  97.  
  98. #define ew_AddTab               9001
  99. #define ew_BlockShift           9010
  100. #define ew_BeginLine            9011
  101. #define ew_CasePrimUpper        9012
  102. #define ew_CasePrimLower        9013
  103. #define ew_CheckBrace           9014
  104. #define ew_ClearLine            9015
  105. #define ew_DeleteCurLine        9016
  106. #define ew_DeleteEOL            9017
  107. #define ew_DeleteLeftChar       9018
  108. #define ew_DeleteWord           9019
  109. #define ew_EndLine              9020
  110. #define ew_Enter                9021
  111. #define ew_GoNextPar            9022
  112. #define ew_GoNextTab            9023
  113. #define ew_GoPrevPar            9024
  114. #define ew_GoPrevTab            9025
  115. #define ew_InputPause           9026
  116. #define ew_InsertBrace          9027
  117. #define ew_InsertDate           9028
  118. #define ew_InsertFilename       9029
  119. #define ew_InsertTime           9030
  120. #define ew_JoinLine             9031
  121. #define ew_LoadUserFile         9032
  122. #define ew_NextCol              9041
  123. #define ew_NextLine             9042
  124. #define ew_NextWord             9043
  125. #define ew_PageBottom           9044
  126. #define ew_PageTop              9045
  127. #define ew_PageScrollHLeft      9046
  128. #define ew_PageScrollHRight     9047
  129. #define ew_PageScrollVDown      9048
  130. #define ew_PageScrollVUp        9049
  131. #define ew_PrevCol              9050
  132. #define ew_PrevLine             9051
  133. #define ew_PrevWord             9052
  134. #define ew_Reflow               9054
  135. #define ew_RemoveTab            9055
  136. #define ew_SetCurLine2Bottom    9056
  137. #define ew_SetCurLine2Middle    9057
  138. #define ew_SetCurLine2Top       9058
  139. #define ew_ShiftTextRight       9059
  140. #define ew_SplitLine            9072
  141. #define ew_StepScrollDown       9073
  142. #define ew_StepScrollLeft       9074
  143. #define ew_StepScrollRight      9075
  144. #define ew_StepScrollUp         9076
  145. #define ew_StripFlow            9077
  146. #define ew_SumBlock             9078
  147. #define ew_TextBoundBegin       9079
  148. #define ew_TextBoundEnd         9080
  149. #define ew_TextToCursor         9081
  150. #define ew_ToggleIns            9082
  151. #define ew_UpcaseFirst          9083
  152. #define ew_UserBlockSort        9084
  153. #define ew_UserFillBlock        9085
  154.  
  155. /* Value that should be returned by EWExecute or by a hook if the extension
  156.    failed. Otherwise return 0 or leave the original EW return code unchanged. */
  157.  
  158. #define ewerr_EXTFAILED 300
  159.  
  160. /* Values returned by EWCallUserExt if the extension could not be executed */
  161.  
  162. #define ewerr_NOSUCHEXTENSION  301
  163. #define ewerr_NOEXECEXPORTED   302
  164.  
  165. /* Values that may be returned after execution of an editing function */
  166.  
  167. #define ewerr_CANTMOVE     351  /* The cursor could not be moved as requested */
  168. #define ewerr_CANTPROCEED  352  /* The function could not be executed  */
  169.  
  170.  /* Values passed by EWSetHook and EWRemoveHook to EW */
  171.  
  172. #define EWHook_FunctionEntry   0
  173. #define EWHook_FunctionExit    1
  174. #define EWHook_KeyboardEntry   2
  175. #define EWHook_PaintEntry      3
  176. #define EWHook_LoadExit        4
  177. #define EWHook_Notify          5
  178.  
  179. /* Values passed by EW to the callback notification hook to identify the event */
  180.  
  181. #define EWNotify_ExitEditor    0
  182. #define EWNotify_CreateClone   1
  183. #define EWNotify_DestroyClone  2
  184. #define EWNotify_FileAutosaved 3
  185. #define EWNotify_FontChanged   4
  186. #define EWNotify_PosChanged    5
  187. #define EWNotify_ActWinChanged 6
  188. #define EWNotify_CharEntry     7
  189. #define EWNotify_CharExit      8
  190.  
  191. /* Possible assignment modes when using EWAddMenuEntry */
  192.  
  193. #define EWMNU_Program   0
  194. #define EWMNU_Command   1
  195. #define EWMNU_Macro     2
  196. #define EWMNU_Extension 3
  197.  
  198. /* Global Flags constants */
  199.  
  200. #define  EWGlbShow              1     /* Show edit window when created */
  201. #define  EWGlbShowWild          2     /* Show windows created with wildcards */
  202. #define  EWGlbMinCC             3     /* Iconize CC after creating window */
  203. #define  EWGlbReShowCC          4     /* Reshow CC after edit window creation */
  204. #define  EWGlbDispShortCuts     5     /* Display shortcuts in menus */
  205. #define  EWGlbReplaceSel        6     /* Typing replace Selection */
  206. #define  EWGlbAddOnLast         7     /* Insert with  on last line */
  207. #define  EWGlbFormatFrom        8     /* Format from current line only */
  208. #define  EWGlbExpansion         9     /* Syntax Expansion enabled */
  209. #define  EWGlbAutoMacros       10     /* Auto Macros enabled */
  210. #define  EWGlbEnterClassic     11     /* Split line with Enter */
  211. #define  EWGlbInsert           12     /* Insert on by default */
  212. #define  EWGlbAutoScroll       13     /* Use autoscroll mode */
  213. #define  EWGlbAlarm            14     /* Beep on error */
  214. #define  EWGlbLog              15     /* Maintain session logging */
  215. #define  EWGlbBak              16     /* Create .BAK flags */
  216. #define  EWGlbWarning          17     /* Warning before file overwrite */
  217. #define  EWGlbLoadList         18     /* @xxxx.xxx files are lists */
  218. #define  EWGlbAutosaveOpt      19     /* Autosave options */
  219. #define  EWGlbAutosave         20     /* Autosave files */
  220. #define  EWGlbDeleteOut        21     /* Suppress .ERR file */
  221. #define  EWGlbGrepRegular      22     /* Grep uses Boolean Search */
  222. #define  EWGlbGrepAnsi         23     /* Grep uses Ansi charset */
  223. #define  EWGlbGrepCase         24     /* Grep makes a case sensitive search */
  224. #define  EWGlbGrepSubDir       25     /* Grep searches in subdirectories */
  225. #define  EWGlbJump             26     /* Jump on Home/End */
  226. #define  EWGlbHasScrollbars    27     /* Edit Windows have Scrollbars */
  227. #define  EWGlbHasRibbon        28     /* Edit Windows have a Ribbon */
  228. #define  EWGlbRepaint          29     /* Scroll method */
  229. #define  EWGlbStripJoin        30     /* Strip Spaces when joining lines */
  230.  
  231. /* Local Flags constants */
  232.  
  233. #define  EWLclbBlank       1          /* Strip trailing blanks */
  234. #define  EWLclbAutoBack    2          /* Backspace behaviour */
  235. #define  EWLclbAutoTab     4          /* Autotab flag */
  236. #define  EWLclbAutoInsert  5          /* AutoInsert braces */
  237. #define  EWLclbAutoComp    6          /* AutoCompress tabs */
  238. #define  EWLclbWordWrap    7          /* Wordwrap */
  239. #define  EWLclbJustify     8          /* Right justification */
  240. #define  EWLclbLoadAscii   9          /* Loaded file supposed to be Ascii file */
  241. #define  EWLclbSaveAscii  10          /* Save file in Ascii format */
  242. #define  EWLclbEOF        11          /* Add a Ctrl Z at the end of the file */
  243. #define  EWLclbAutoIndent 12          /* Auto Indentation */
  244.  
  245. /* Search Flags constants */
  246.  
  247. #define  EWSearchbBackward  1         /* Backward search */
  248. #define  EWSearchbBlock     2         /* Search within marked block only */
  249. #define  EWSearchbCase      3         /* Case sensitive search */
  250. #define  EWSearchbKeepCase  4         /* Keep case type when replacing string */
  251. #define  EWSearchbGlobal    5         /* Global Search */
  252. #define  EWSearchbGothru    6         /* Replace without prompting */
  253. #define  EWSearchbRegular   7         /* Boolean search flag */
  254. #define  EWSearchbWord      8         /* Word-only search */
  255. #define  EWSearchbAcross    9         /* Search across edited files */
  256.  
  257. /* Compile command codes */
  258.  
  259. #define  EWCompileCommand   0
  260. #define  EWMakeCommand      1
  261. #define  EWBuildCommand     2
  262. #define  EWDebugCommand     3
  263. #define  EWExecuteCommand   4
  264.  
  265. /* Macro string codes */
  266.  
  267. #define  EWMacro_Time       0
  268. #define  EWMacro_Date       1
  269. #define  EWMacro_FileName   2
  270.  
  271. /* Position codes */
  272.  
  273. #define  EWPosition_Top     0
  274. #define  EWPosition_Middle  1
  275. #define  EWPosition_Bottom  2
  276.  
  277. /* Selection modes */
  278.  
  279. #define  EWSelection_None   0
  280. #define  EWSelection_Line   1
  281. #define  EWSelection_Stream 2
  282. #define  EWSelection_Block  3
  283.  
  284. /* Write modes for EWWriteBlock */
  285.  
  286. #define EWWrite_ReWrite     1
  287. #define EWWrite_Append      2
  288.  
  289. typedef struct tagTSelStruct
  290. {
  291.  
  292.   unsigned int SelType;
  293.   int FirstSelLine;
  294.   int LastSelLine;
  295.   int FirstSelCol;
  296.   int LastSelCol;
  297.   int StartSelIndex;
  298.   int EndSelIndex;
  299.  
  300. } TSelStruct;
  301.  
  302. typedef TSelStruct FAR* PSelStruct;
  303.  
  304. typedef void (FAR PASCAL* TEnumEditorsProc)(long EditorId, char FAR* Name);
  305. typedef void (FAR PASCAL* TEnumClonesProc)(HANDLE CloneHandle, BYTE CloneId);
  306. typedef int  (FAR PASCAL* TFuncEntryHook)(unsigned int command);
  307. typedef int  (FAR PASCAL* TFuncExitHook)(unsigned int command, int FAR* pRetcode);
  308. typedef int  (FAR PASCAL* TKbdEntryHook)(MSG MSg);
  309. typedef int  (FAR PASCAL* TPaintEntryHook)(HDC DC,
  310.                                            PAINTSTRUCT FAR* PaintInfo,
  311.                                            PSelStruct SelInfo,
  312.                                            HANDLE hWindow);
  313. typedef int  (FAR PASCAL* TLoadExitHook)(long EditorId);
  314. typedef int  (FAR PASCAL* TNotifyHook)(unsigned int code, unsigned int wParam, long lParam);
  315. typedef int  (FAR PASCAL* TExecFunc)(unsigned int MenuId);
  316.  
  317. /* Editing functions */
  318.  
  319. int FAR PASCAL EWAddTab(int col, unsigned int fAdd);
  320. int FAR PASCAL EWAlternateHelp(int col, int row);
  321. int FAR PASCAL EWBeginLine(unsigned int fSkipToPrev);
  322. int FAR PASCAL EWBlockShift(void);
  323. int FAR PASCAL EWBlockSort(unsigned int fAscend);
  324. int FAR PASCAL EWCase(unsigned int fUpper);
  325. int FAR PASCAL EWCheckBrace(int col, int row);
  326. int FAR PASCAL EWClearLine(int row);
  327. int FAR PASCAL EWExecCompileCommand(unsigned int commandindex);
  328. int FAR PASCAL EWDeleteChar(void);
  329. int FAR PASCAL EWDeleteCurLine(void);
  330. int FAR PASCAL EWDeleteEOL(void);
  331. int FAR PASCAL EWDeleteLeft(unsigned int fDeleteCurrent);
  332. int FAR PASCAL EWDeleteLines(int start, int num);
  333. int FAR PASCAL EWDeleteSelection(void);
  334. int FAR PASCAL EWDeleteWord(void);
  335. int FAR PASCAL EWEndLine(unsigned int fSkipToNext, unsigned int fStrip);
  336. int FAR PASCAL EWFillBlock(unsigned char ch);
  337. int FAR PASCAL EWGetFile(char FAR* Name, int row);
  338. int FAR PASCAL EWGotoBookmark(unsigned int index);
  339. int FAR PASCAL EWGotoNextParagraph(void);
  340. int FAR PASCAL EWGotoNextTab(void);
  341. int FAR PASCAL EWGotoPrevTab(void);
  342. int FAR PASCAL EWGotoPrevParagraph(void);
  343. int FAR PASCAL EWGotoCompileError(unsigned int fNext);
  344. int FAR PASCAL EWGotoLine(int row);
  345. int FAR PASCAL EWGotoXY(int col, int row);
  346. int FAR PASCAL EWGotoSelection(unsigned int fBegin);
  347. int FAR PASCAL EWInsertBrace(int col, int row);
  348. int FAR PASCAL EWInsertLines(int start, int num);
  349. int FAR PASCAL EWInsertMacroText(int col, int row, unsigned int macrotype);
  350. int FAR PASCAL EWJoinLine(int row);
  351. int FAR PASCAL EWLoadUserFile(int col, int row);
  352. int FAR PASCAL EWNextCol(void);
  353. int FAR PASCAL EWNextLine(void);
  354. int FAR PASCAL EWNextWord(unsigned int fNext);
  355. int FAR PASCAL EWTopOfPage(unsigned int fTop);
  356. int FAR PASCAL EWHorzPageScroll(unsigned int fLeft);
  357. int FAR PASCAL EWVerPageScroll(unsigned int fUp);
  358. int FAR PASCAL EWPrevCol(void);
  359. int FAR PASCAL EWPrevLine(void);
  360. int FAR PASCAL EWPaste(unsigned int fInsert);
  361. int FAR PASCAL EWReflow(int row);
  362. int FAR PASCAL EWRefresh(unsigned int bAsk);
  363. int FAR PASCAL EWRemoveBookmark(unsigned int index);
  364. int FAR PASCAL EWSaveFile(char FAR* Name);
  365. int FAR PASCAL EWSelectAll(void);
  366. int FAR PASCAL EWSetBookmark(int col, int row);
  367. int FAR PASCAL EWSetClipboard(unsigned int fAppend);
  368. int FAR PASCAL EWPositionCurLine(unsigned int position);
  369. int FAR PASCAL EWShiftTextRight(int col, int row, int count);
  370. int FAR PASCAL EWSplitLine(int col, int row);
  371. int FAR PASCAL EWStepScroll(int dX, int dY);
  372. int FAR PASCAL EWSumBlock(void);
  373. int FAR PASCAL EWStripFlow(void);
  374. int FAR PASCAL EWTopOfText(unsigned int fTop);
  375. int FAR PASCAL EWTextToCurSor(void);
  376. int FAR PASCAL EWToggleInsert(void);
  377. int FAR PASCAL EWUpcaseFirst(int col, int row);
  378. int FAR PASCAL EWWriteBlock(int startrow,
  379.                             int endrow,
  380.                             int startcol,
  381.                             int endcol,
  382.                             char FAR* Name,
  383.                             unsigned int mode,
  384.                             unsigned int fBlock,
  385.                             unsigned int fCompress);
  386.  
  387.  
  388. /* Service functions */
  389.  
  390. long FAR PASCAL EWAddMenuEntry(char FAR* Command,
  391.                                char FAR* Title,
  392.                                unsigned int CommandId,
  393.                                unsigned int AssignMode,
  394.                                unsigned int RoutineId);
  395. int FAR PASCAL EWBeginSelection(unsigned int SelType, int col, int row);
  396. int FAR PASCAL EWCallUserExt(char FAR* Name);
  397. long FAR PASCAL EWEditFile(char FAR* Name);
  398. int FAR PASCAL EWEndSelection(void);
  399. void FAR PASCAL EWEnumClones(long EditorId, TEnumClonesProc CloneEnumProc);
  400. void FAR PASCAL EWEnumEditors(TEnumEditorsProc EdEnumProc);
  401. long FAR PASCAL EWFind(unsigned int FAR* MatchLen);
  402. unsigned int FAR PASCAL EWFindRegular(char FAR* src,
  403.                                       char FAR* dest,
  404.                                       unsigned int FAR* MatchLen);
  405. long FAR PASCAL EWGetCaretPos(void);
  406. unsigned int FAR PASCAL EWGetCloneNum(void);
  407. long FAR PASCAL EWGetCurWord(void);
  408. long FAR PASCAL EWGetCurrentEditor(void);
  409. char FAR* FAR PASCAL EWGetFileName(long EditorId);
  410. int FAR PASCAL  EWGetGlobalFlag(unsigned int FlagId);
  411. unsigned int FAR PASCAL EWGetInsertState(void);
  412. char FAR* FAR PASCAL EWGetLineAt(int index);
  413. int FAR PASCAL EWGetLineCount(void);
  414. int FAR PASCAL EWGetLocalFlag(unsigned int FlagId);
  415. int FAR PASCAL EWGetSearchFlag(unsigned int FlagId);
  416. void FAR PASCAL EWGetSelection(PSelStruct Selection);
  417. long FAR PASCAL EWGetTextPos(void);
  418. unsigned int FAR PASCAL EWGetVersion(void);
  419. unsigned int FAR PASCAL EWGetWindowHandle(void);
  420. void FAR PASCAL EWRemoveHook(unsigned int hFlag, void FAR* HookAddress);
  421. int FAR PASCAL EWRemoveMenuEntry(long Id);
  422. long FAR PASCAL EWRepeatFind(unsigned int FAR* MatchLen);
  423. long FAR PASCAL EWSetCurrentEditor(long EditorId);
  424. void FAR PASCAL EWSetFindPattern(char FAR* pattern);
  425. int FAR PASCAL EWSetGlobalFlag(unsigned int FlagId, unsigned int value);
  426. void FAR PASCAL EWSetHook(unsigned int hFlag, void FAR* HookAddress);
  427. int FAR PASCAL EWSetLineAt(char FAR* P, int index);
  428. int FAR PASCAL EWSetLocalFlag(unsigned int FlagId, unsigned int value);
  429. void FAR PASCAL EWSetModified(void);
  430. int FAR PASCAL EWSetSearchFlag(unsigned int FlagId, unsigned int value);
  431. int FAR PASCAL EWStopSelection(int col, int row);
  432. int FAR PASCAL EWUpdateSelection(int col, int row);
  433. void FAR PASCAL EWWriteMessage(char FAR* message);
  434. unsigned int FAR PASCAL EWGetTextWindowHandle(void);
  435. unsigned int FAR PASCAL EWGetInstance(void);
  436. unsigned int FAR PASCAL EWIsModified(void);
  437.  
  438. #endif /* _INC_EWAPI */
  439.